From: Chris Swindle Date: Tue, 3 Oct 2017 10:32:29 +0000 (+0100) Subject: Merge branch 'master' into alt-registry-publish X-Git-Tag: archive/raspbian/0.35.0-2+rpi1~3^2^2^2^2^2^2^2~22^2~5^2~1^2~10 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success//%22http:/www.example.com/cgi/success/?a=commitdiff_plain;h=4f089431591ca1afd678feddc6df400de6c4d93b;p=cargo.git Merge branch 'master' into alt-registry-publish Conflicts: src/cargo/core/package.rs --- 4f089431591ca1afd678feddc6df400de6c4d93b diff --cc src/cargo/core/package.rs index 9fc9e91ad,885dad937..57e0f700e --- a/src/cargo/core/package.rs +++ b/src/cargo/core/package.rs @@@ -84,18 -87,30 +87,30 @@@ impl Package Ok(pkg) } + /// Get the manifest dependencies pub fn dependencies(&self) -> &[Dependency] { self.manifest.dependencies() } + /// Get the manifest pub fn manifest(&self) -> &Manifest { &self.manifest } + /// Get the path to the manifest pub fn manifest_path(&self) -> &Path { &self.manifest_path } + /// Get the name of the package pub fn name(&self) -> &str { self.package_id().name() } + /// Get the PackageId object for the package (fully defines a packge) pub fn package_id(&self) -> &PackageId { self.manifest.package_id() } + /// Get the root folder of the package pub fn root(&self) -> &Path { self.manifest_path.parent().unwrap() } + /// Get the summary for the package pub fn summary(&self) -> &Summary { self.manifest.summary() } + /// Get the targets specified in the manifest pub fn targets(&self) -> &[Target] { self.manifest.targets() } + /// Get the current package version pub fn version(&self) -> &Version { self.package_id().version() } + /// Get the package authors pub fn authors(&self) -> &Vec { &self.manifest.metadata().authors } + /// Whether the package is set to publish - pub fn publish(&self) -> bool { self.manifest.publish() } + pub fn publish(&self) -> &Option> { self.manifest.publish() } + /// Whether the package uses a custom build script for any target pub fn has_custom_build(&self) -> bool { self.targets().iter().any(|t| t.is_custom_build()) }